
from celery.result import AsyncResult
from celery_task import celery

'''
取执行结果
'''
id = "01935177-fdef-4c60-ae29-6c9b8194186f"
async_result = AsyncResult(id=id,app=celery)

if async_result.successful():
    result = async_result.get()
    print(result)
elif async_result.failed():
    print("Fail")
elif async_result.status == "PENDING":
    print("执行者")
elif async_result.status == "RETRY":
    print("重试")
elif async_result.status == "STARTED":
    print("任务已经开始被执行")